#include "GLLine.h"
#include "RenderController.h"
#include "common.h"
QVector<QVector3D> GLLine::getVertices() const
{
	QVector<QVector3D> ret;

	auto backSize	= gController->backgroundSize();
	auto windowSize = gController->viewSize() * qApp->devicePixelRatio();

	auto scale = gController->scale();

	auto windowPosStart = backgroundPosToWindowPos(mStart, backSize, windowSize, scale);
	auto verPosStart	= posNormal(windowPosStart, windowSize);

	auto windowPosStop = backgroundPosToWindowPos(mStop, backSize, windowSize, scale);
	auto verPosStop	   = posNormal(windowPosStop, windowSize);
	ret.append(QVector3D(verPosStart.x(), verPosStart.y(), 0.0));
	ret.append(QVector3D(verPosStop.x(), verPosStop.y(), 0.0));
	return ret;
}
const QMatrix4x4& GLLine::compMat() const
{
	return mCompMat;
}
void GLLine::setCompMat(const QMatrix4x4& mat)
{
	mCompMat = mat;
}
